<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/home::header">
</head>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body, html {
	overflow-y: auto;
	background: #fff
}
</style>


</head>

<body>
	<div class="project-view">
		<form id="planForm">

			<input type="text" readonly="readonly" style="display: none" name="id" /> 
			<input type="text" readonly="readonly" style="display: none" name="palnTypeName" /> 
			<input type="text" readonly="readonly" style="display: none" name="userName" />
		
			<table width="100%" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td width="18%" align="right"><span class="color-red">*</span>任务描述：</td>
					<td width="82%"><input type="text" class="input-pub"
						name="taskDescription"  id="taskDescription" /></td>
				</tr>
				<tr>
					<td align="right"><span class="color-red">*</span>计划节点：</td>
					<td><input type="text" class="laydate-icon"
						style="width: 96%; height: 40px" onclick="laydate()"
						name="planNode"  id="planNode"/></td>
				</tr>
				<tr>
					<td align="right"><span class="color-red">*</span>计划类别：</td>
					<td><select class="select-pub" name="palnTypeId"  id="palnTypeId">
							<option>请选择</option>
					</select></td>
				</tr>
				<tr>
					<td align="right"><span class="color-red">*</span>责任人：</td>
					<td><select class="select-pub" name="userId"    id="userId"     >
							<option>请选择</option>
						
					</select></td>
				</tr>
			</table>
		</form>
	</div>
</body>

<script th:inline="javascript">  
/*<![CDATA[*/  
       
             function verifyNull(obj){
	
		if(obj == null||obj.val()==""||obj.val()=="请选择"){
			top.$.Zebra_Dialog('<div class="prompt"><div class="warning-icon"></div><div class="success-title">输入的内容不能包含空</div></div>', {
				'title':'提示',
	 	         'buttons':['确定']
		     });
			return false;
		}
	return true;
}      
 function getData(){
	if(!verifyNull($("#taskDescription"))){
 		return false;
 	}
	if(!verifyNull($("#planNode"))){
 		return false;
 	}
	if(!verifyNull($("#palnTypeId"))){
 		return false;
 	}
	if(!verifyNull($("#userId"))){
 		return false;
 	}
	return true;
 }
//加载用户
$(function() { 
$.ajax({
    type: 'GET',
    url: '/User/users?timestamp='+new Date().getTime(),
    success: function (data) {
        var data = eval(data);
        var proOPts = "";
        $.each(data, function (i) {
            proOPts += "<option value='" + data[i].id+ "'>" + data[i].userName + "</option>";
        });
        $("#userId").append(proOPts);
         var planManage = [[${planManage}]];  
         if(planManage!=null){
            loadData(planManage);
         }
    }
}); 
//加载计划类别
$.ajax({
    type: 'GET',
    url: '/PlanType/planTypes?timestamp='+new Date().getTime(),
    success: function (data) {
        var data = eval(data);
        var proOPts = "";
        $.each(data, function (i) {
            proOPts += "<option value='" + data[i].id+ "'>" + data[i].typeName + "</option>";
        });
        $("#palnTypeId").append(proOPts);
        var planManage = [[${planManage}]];  
        if(planManage!=null){
            loadData(planManage);
         }
    }
}); 



});
    
/*]]>*/  
</script>

<script  type="text/javascript">  
$(function() { 
$('#userId').change(function(){  
$("input[name='userName']").val($(this).children('option:selected').text());
}); 

$('#palnTypeId').change(function(){  
	$("input[name='palnTypeName']").val($(this).children('option:selected').text());
	}); 
});
</script>

</html>
